﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class NPS_app_Monitoring_AllResponden : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            loadForm();
            loadRespondent();
        }
    }

    protected void loadForm()
    {
        ddlBatch.DataSource = Batch;
        ddlBatch.DataBind();
        ddlBatch.SelectedIndex = 0;
    }
    protected void loadRespondent()
    {
        Controller.NPSCustomerContactController ncc = new Controller.NPSCustomerContactController();
        gvContactPerson.DataSource = ncc.getCustomerBatch(Convert.ToInt16(ddlBatch.SelectedItem.Text));
        gvContactPerson.DataBind();

    }

    protected void ddlBatch_SelectedIndexChanged(object sender, EventArgs e)
    {
        loadRespondent();
    }
    protected void OnPaging(object sender, GridViewPageEventArgs e)
    {
        gvContactPerson.PageIndex = e.NewPageIndex;
        gvContactPerson.DataBind();
    }
}
